package acmCoder;

import java.util.Scanner;

import util.Prime;

public class ResolveToPrimeMultiply {
	public static void main(String[] args) {
		Scanner  scanner = new Scanner(System.in);
		int number;
		while (scanner.hasNext()) {
			number = scanner.nextInt();
			getPrime(number);
		}
		scanner.close();
	}
	
	public static void getPrime(int number){
		if(number == 1){
			System.out.println("this is a prime,and the factor is: 1");
			return ;
		}
		if(Prime.isPrime(number) ){
			System.out.println("this is a prime,and the factor is: 1 and " + number);
			return ;
		}
		int nextFactor = 2;
		while(number != 1){
			if(number % nextFactor == 0){
				number /= nextFactor;
				System.out.println(nextFactor);
			}else {
				nextFactor = Prime.getNextPrime(nextFactor);
			}
		}
	}
}
